package com.association.logging.service.impl;

import com.association.logging.mapper.LogMapper;
import com.association.logging.model.Log;
import com.association.logging.service.LogService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.len.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import javax.annotation.Resource;
import java.util.List;
@Service
public class LogServiceImpl extends ServiceImpl< LogMapper,Log> implements LogService {
    @Resource
    LogMapper logMapper;

    @Override
    public List<Log> logList(Log log) {
        QueryWrapper<Log> wrapper = new QueryWrapper<>();
        wrapper.eq("userName",log.getUserName());
        wrapper.eq("browser",log.getUserName());
        wrapper.eq("type",log.getUserName());
        wrapper.eq("userName",log.getUserName());
        return this.list(new QueryWrapper<Log>().eq("is_del",0));
    }

    @Override
    public Boolean deleteAll(){
        return this.remove(new QueryWrapper<Log>().eq("is_del",0));
    }

    @Override
    public Boolean record(Log log) {
        return this.save(log);
    }
}
